package com.duang.framework.service;

import com.duang.framework.core.Resource;
import com.duang.framework.dao.BaseDao;

public class BaseServiceTemplate<T> implements BaseService<T> {


	@Resource("baseDao")
	protected BaseDao<T> baseDao;

	public BaseServiceTemplate() {

	}

	public BaseServiceTemplate(BaseDao<T> baseDao) {
		this.baseDao = baseDao;

	}

	@Override
	public void save(T t) {
		baseDao.save(t);
	}

	@Override
	public void delete(int id) {
		baseDao.delete(id);
	}

	@Override
	public T getById(int id) {
		return baseDao.getById(id);
	}

	@Override
	public void update(T t) {
		baseDao.update(t);
	}

	@Override
	public BaseDao<T> getDao() {
		return baseDao;
	}

}
